import React, { useContext } from 'react'
import { context } from './Providers'
import Abc from './Abc'

function Com() {
    const { state, dispatch } = useContext(context)
    return (
        <div>
            我是Com组件 ---  { state.name }
            <button onClick = {() => {
                dispatch({ type: "CHANGE_NAME" })
            }}>修改姓名</button>
            <Abc/>
        </div>
    )
}

export default Com
